<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="redis" uri="http://www.shopjsp.com/redisTag/functions" %>
<c:set var="basePath" value="${redis:getSysConfig('base_path_back')}"/>
<c:set var="srcPath" value="${redis:getSysConfig('sysFileVisitRoot_back')}"/>
<script type="text/javascript">
    /**
     * 查看会员详情
     */
    function customerDetailInfo(id){
        $.ajax({
            type: "POST",
            dataType: "JSON",
            url: "${basePath}/back/customer/getCustomerObject.sjson",
            data: {customerId:id},
            success: function(result){
                var data = JSON.parse(result.data);
                /**重置详情页中所有html展示信息**/
                resetDetailTable("detailTableCustomer");
                /**设置展示信息**/
                $("#d_photo").html("<img id='uploadImg_detail_1' class='uploadImg' onMouseOver='showDetailBigImage(1,3,3,0)'  onMouseOut='showDetailRebackImage(1,1,1)' src='${uploadPath}/"+data.list[0].photoUrl+"'  onerror='this.src=\"${srcPath}/common/images/mrbj.png\"' width='50px' height='50px' />");
                if(data.list[0].type==1){
                    $("#d_type").html("企业用户");
                }else if (data.list[0].type==2){
                    $("#d_type").html("供应商");
                }else if (data.list[0].type==3){
                    $("#d_type").html("普通用户");
                }
                $("#d_loginName").html(data.list[0].loginName);
                $("#d_nickName").html(data.list[0].nickName);
                var sexStr = "";
                <c:forEach items="${redis:getBasicKeyBook('sex')}" var="kb">
                if(data.list[0].sex==${kb.value}){
                    sexStr="${kb.name}";
                }
                </c:forEach>
                $("#d_sex").html(sexStr);

                if(data.list[0].birthday!=""&&data.list[0].birthday!=undefined){
                    $("#d_birthday").html(new Date(data.list[0].birthday).Format("yyyy-MM-dd"));
                }else{
                    $("#d_birthday").html("");
                }
                $("#d_phone").html(data.list[0].phone);
                $("#d_userEmail").html(data.list[0].email);
                $("#d_balance").html(data.countBankroll+"元");
                $("#d_countCoin").html(data.countCoin+"分");

                if(data.list[0].lockedState==0){
                    $("#d_lockedState").html("<font class='color_001'>未冻结</font>");
                }else{
                    $("#d_lockedState").html("<font class='color_002'>已冻结</font>");
                }

                $("#d_registerIp").html(data.list[0].registerIp);
                if(data.list[0].registerDate!=""&&data.list[0].registerDate!=undefined){
                    $("#d_registerDate").html(new Date(data.list[0].registerDate).Format("yyyy-MM-dd hh:mm:ss"));
                }

                if(data.list[0].wxUserOpenId=="" || data.list[0].wxUserOpenId==undefined){
                    $("#d_wxUserOpenId").html("<font class='color_002'>未关联</font>");
                }else{
                    $("#d_wxUserOpenId").html("<font class='color_001'>已关联</font>");
                }
                $("#d_notes").html(data.list[0].notes);
            }
        });
    }
</script>
<!--详情模态框（Modal） -->
<div class="modal fade" id="customerDetailModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog" style="width:70%">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
				<h5 class="modal-title" id="myModalLabel">会员详情</h5>
			</div>
			<div class="modal-body">
				<table id="detailTableCustomer" align="center" class="addOrEditTable table table-bordered" style="width:100%;">
					<tr>
						<td class="toright_td" width="150px">头像预览:</td>
						<td class="toleft_td" width="250px">&nbsp;&nbsp;<span id="d_photo"></span></td>
						<td class="toright_td" width="150px">会员类型:</td>
						<td class="toleft_td" width="250px">&nbsp;&nbsp;<span id="d_type"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">登录名称:</td>
						<td class="toleft_td" >&nbsp;&nbsp;<span id="d_loginName"></span></td>
						<td class="toright_td" width="150px">昵称:</td>
						<td class="toleft_td" >&nbsp;&nbsp;<span id="d_nickName"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">性别:</td>
						<td class="toleft_td" >&nbsp;&nbsp;<span id="d_sex"></span></td>
						<td class="toright_td" width="150px">生日:</td>
						<td class="toleft_td" >&nbsp;&nbsp;<span id="d_birthday"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">手机:</td>
						<td class="toleft_td" >&nbsp;&nbsp;<span id="d_phone"></span></td>
						<td class="toright_td" width="150px">邮箱:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_userEmail"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">注册ip:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_registerIp"></span></td>
						<td class="toright_td" width="150px">注册时间:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_registerDate"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">账户余额:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_balance"></span></td>
						<td class="toright_td" width="150px">积分余额:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_countCoin"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">冻结状态:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_lockedState"></span></td>
						<td class="toright_td" width="150px">是否关联微信:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_wxUserOpenId"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">简介:</td>
						<td class="toleft_td" colspan="3">&nbsp;&nbsp;<span id="d_notes"></span></td>
					</tr>
				</table>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			</div>
		</div><!-- /.modal-content -->
	</div><!-- /.modal -->
</div>